﻿Imports System
Imports System.ComponentModel

Namespace System.Workflow.ComponentModel.Design
    Friend Class DummyTypeDescriptorContext
        Implements ITypeDescriptorContext, IServiceProvider
        ' Methods
        Public Sub New(ByVal serviceProvider As IServiceProvider, ByVal component As Object, ByVal propDescriptor As PropertyDescriptor)
            Me.serviceProvider = serviceProvider
            Me.propDescriptor = propDescriptor
            Me.component = component
        End Sub

        Public Function GetService(ByVal serviceType As Type) As Object
            If (Not Me.serviceProvider Is Nothing) Then
                Return Me.serviceProvider.GetService(serviceType)
            End If
            Return Nothing
        End Function

        Public Sub OnComponentChanged()
        End Sub

        Public Function OnComponentChanging() As Boolean
            Return True
        End Function


        ' Properties
        Public ReadOnly Property Container As IContainer
            Get
                Return Nothing
            End Get
        End Property

        Public ReadOnly Property Instance As Object
            Get
                Return Me.component
            End Get
        End Property

        Public ReadOnly Property PropertyDescriptor As PropertyDescriptor
            Get
                Return Me.propDescriptor
            End Get
        End Property


        ' Fields
        Private component As Object
        Private propDescriptor As PropertyDescriptor
        Private serviceProvider As IServiceProvider
    End Class
End Namespace

